﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Group3.MediaTool.Interface
{
    public class MemberValue<T> : IMemberValue<T>
        where T: class
    {

        public T Origin
        {
            get;
            set;
        }

        public T Current
        {
            get;
            set;
        }

        public void CommitChanges()
        {
            Origin = Current;
        }


        public void UndoChanges()
        {
            Current = Origin;
        }
    }

    public class NullableMemberValue<T> : IMemberValue<Nullable<T>>
        where T : struct
    {
        public T? Origin
        {
            get;
            set;
        }

        public T? Current
        {
            get;
            set;
        }

        public void CommitChanges()
        {
            Origin = Current;
        }


        public void UndoChanges()
        {
            Current = Origin;
        }

       
    }

}
